<%@ Page Language="C#" MasterPageFile="~/User/EditProfile.master" AutoEventWireup="true"
    ValidateRequest="false" CodeFile="EditProfile.aspx.cs" Inherits="User_EditProfile"
    Title="CompareXpress - Register With CompareXpress" MaintainScrollPositionOnPostback="true" %>

<%@ Register Src="../controls/usrDate.ascx" TagName="usrDate" TagPrefix="uc2" %>
<%@ Register Src="../controls/usrOccupation.ascx" TagName="usrOccupation" TagPrefix="uc3" %>
<%@ Register Src="../controls/usrJobNature.ascx" TagName="usrJobNature" TagPrefix="uc4" %>
<%@ Register Src="../controls/usrIdType.ascx" TagName="usrIdType" TagPrefix="uc5" %>
<%@ Register Src="../controls/usrIdNumber.ascx" TagName="usrIdNumber" TagPrefix="uc6" %>
<%@ Register Src="../controls/usrPhoneNo.ascx" TagName="usrPhoneNo" TagPrefix="uc7" %>
<%@ Register Src="../controls/usrMaritalStatus.ascx" TagName="usrMaritalStatus" TagPrefix="uc8" %>
<%@ Register Src="../controls/usrGender.ascx" TagName="usrGender" TagPrefix="uc9" %>
<%@ Register Src="../controls/usrSalutation.ascx" TagName="usrSalutation" TagPrefix="uc10" %>
<%@ Register Src="../controls/usrNationality.ascx" TagName="usrNationality" TagPrefix="uc11" %>
<%@ Register Src="~/controls/usrNoJS.ascx" TagName="usrNoJS" TagPrefix="ucNoJS" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <%--For Each Control On Blur--%>
    <%--For All Control On Submit--%>

    <script src="../includes/ValidationError.js" type="text/javascript"></script>

    <script src="../includes/ValidationEffect.js" type="text/javascript"></script>

    <script src="../controls/IdNumber.js" type="text/javascript"></script>

    <script src="../controls/CE_Date.js" type="text/javascript"></script>

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="elements_inner_wrapper">

            <div class="rightcol">
                <div class="content_right">
                    <div class="content_right">
                    
                    <!-- #Include file="../includes/rcol_services.aspx" -->
                    <div class="seperator"></div>
                    <div class="foot"></div>
                    </div>
                </div>
            </div>
    
    <div id="contentBody">
        <ucNoJS:usrNoJS ID="usrNoJS1" runat="server" />
        <div class="section">
            <div id="divEditCustomer">
                <fieldset>
                    <asp:ValidationSummary ID="vsNewCustomer" runat="server" ValidationGroup="profile"
                        ShowSummary="True" CssClass="errorSummary" HeaderText="Oops please complete the form">
                    </asp:ValidationSummary>
                    <asp:Label ID="lblNewCustomerMessage" Visible="false" runat="server"></asp:Label>
                    <h1>Edit Profile</h1>
                    <%--<div class="row">
                            <label for="Email">
                                Email address</label>
                            <div class="field usernameid">
                                <span class="indicator">
                                    <asp:TextBox ID="txtEmailAddress" class="text" runat="server"></asp:TextBox></span>
                                <span class="indicator">
                                    <asp:RequiredFieldValidator ID="rfvEmail" runat="server" Text="*" validationErrorCssClass="validationError"
                                        ValidationGroup="profile" ErrorMessage="Require Email address" ControlToValidate="txtEmailAddress"
                                        Display="Dynamic"></asp:RequiredFieldValidator></span> <span class="indicator">
                                            <asp:RegularExpressionValidator ID="rfvEmailValid" Text="*" validationErrorCssClass="validationError"
                                                runat="server" ValidationGroup="profile" ErrorMessage="Invalid Email address."
                                                ControlToValidate="txtEmailAddress" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                                Display="Dynamic"></asp:RegularExpressionValidator></span></div>
                            <div class="clear"></div>
                        </div>
                        <div class="row">
                            <label for="Password">
                                Password</label>
                            <div class="field">
                                <span class="indicator">
                                    <asp:TextBox ID="txtAuthCode" class="text" runat="server" TextMode="Password"></asp:TextBox></span>
                                <span class="indicator">
                                    <asp:RequiredFieldValidator ID="rfvPassword" runat="server" validationErrorCssClass="validationError"
                                        ValidationGroup="profile" ErrorMessage="Require Password" Text="*" ControlToValidate="txtAuthCode"
                                        Display="Dynamic"></asp:RequiredFieldValidator></span> <span class="indicator">
                                            <asp:CustomValidator ID="csvPasswordLength" ControlToValidate="txtAuthCode" runat="server"
                                                ErrorMessage="Password length should be at least 6." Text="*" ClientValidationFunction="CheckPasswordLength"
                                                OnServerValidate="CheckPasswordLength" Display="Dynamic" validationErrorCssClass="validationError"
                                                ValidationGroup="profile"></asp:CustomValidator>
                                        </span>
                            </div>
                            <div class="clear"></div>
                        </div>
                        <div class="row">
                            <label for="ConfirmPassword">
                                Confirm Password</label>
                            <div class="field">
                                <span class="indicator">
                                    <asp:TextBox ID="txtAuthCodeConfirm" class="text" runat="server" TextMode="Password"></asp:TextBox></span>
                                <span class="indicator">
                                    <asp:RequiredFieldValidator ID="rfvConfirmPassword" runat="server" validationErrorCssClass="validationError"
                                        ValidationGroup="profile" ErrorMessage="Require Confirm Password" Text="*" Display="Dynamic"
                                        ControlToValidate="txtAuthCodeConfirm"></asp:RequiredFieldValidator></span>
                                <span class="indicator">
                                    <asp:CompareValidator ID="csvConfirmPassword" runat="server" Display="Dynamic" validationErrorCssClass="validationError"
                                        ValidationGroup="profile" ErrorMessage="Both password should be same" Text="*"
                                        ControlToValidate="txtAuthCodeConfirm" ControlToCompare="txtAuthCode"></asp:CompareValidator>
                                </span>
                            </div>
                            <div class="clear"></div>
                        </div>--%>
                    <%-- <div class="row">
                        <label for="salutation" class="mand_red">
                            Salutation</label>
                        <div class="field">
                            <span class="indicator">
                                <uc10:usrSalutation ID="ddlSalutation" ValidationGroup="profile" IsEnabled="true"
                                    ErrorMessage="Choose Salutation" runat="server" />
                            </span>
                        </div>
                        <div class="clear">
                        </div>
                    </div>--%>
                    <div class="row">
                        <label for="fnam" class="mand_red">
                            First Name</label>
                        <div class="field">
                            <span class="indicator">
                                <asp:TextBox ID="txtFirstName" MaxLength="50" class="text" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfvFirstName" runat="server" validationErrorCssClass="validationError"
                                    ValidationGroup="profile" ErrorMessage="" Text="" ControlToValidate="txtFirstName"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="revFirstName" runat="server" ValidationGroup="profile"
                                    ValidationExpression="^[a-zA-Z''-'\s]{1,50}$" validationErrorCssClass="validationError"
                                    ControlToValidate="txtFirstName" ErrorMessage=""></asp:RegularExpressionValidator></span></div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row">
                        <label for="sname" class="mand_red">
                            Family Name (Surname)</label>
                        <div class="field">
                            <span class="indicator">
                                <asp:TextBox ID="txtSurName" MaxLength="50" class="text" runat="server"></asp:TextBox></span>
                            <span class="indicator">
                                <asp:RequiredFieldValidator ID="rfvSurName" runat="server" validationErrorCssClass="validationError"
                                    ValidationGroup="profile" ErrorMessage="" Text="" ControlToValidate="txtSurName"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="revSurname" runat="server" ValidationGroup="profile"
                                    ValidationExpression="^[a-zA-Z''-'\s]{1,50}$" validationErrorCssClass="validationError"
                                    ControlToValidate="txtSurName" ErrorMessage=""></asp:RegularExpressionValidator>
                            </span>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row">
                        <label for="DOB" class="mand_red">
                            Date of Birth</label>
                        <div class="field">
                            <span class="indicator">
                                <uc2:usrDate ValidationGroup="profile" ErrorMessage="Select Your Date of Birth" ID="usrDOB"
                                    runat="server" />
                            </span>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row">
                        <label for="gender" class="mand_red">
                            Gender</label>
                        <div class="field">
                            <span class="indicator">
                                <uc9:usrGender ID="ddlGender" ValidationGroup="profile" IsEnabled="true" ErrorMessage="Choose Gender."
                                    runat="server" />
                            </span>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row">
                        <label for="nationality" class="mand_red">
                            Nationality</label>
                        <div class="field">
                            <span class="indicator">
                                <uc11:usrNationality ValidationGroup="profile" ID="ddlNationality" runat="server"
                                    IsEnabled="True" />
                            </span>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row">
                        <label for="Occupation" class="mand_red">
                            Occupation</label>
                        <div class="field">
                            <span class="indicator">
                                <uc3:usrOccupation ID="ddlOccupation" runat="server" IsEnabled="true" ValidationGroup="profile"
                                    ErrorMessage="Choose Occupation." />
                            </span>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row">
                        <label for="Job Nature" class="mand_red">
                            Job Nature</label>
                        <div class="field">
                            <span class="indicator">
                                <uc4:usrJobNature ID="ddlJobNature" runat="server" IsEnabled="true" ValidationGroup="profile"
                                    ErrorMessage="Choose Job nature." />
                            </span>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row">
                        <label for="Marital Status" class="mand_red">
                            Marital Status</label>
                        <div class="field">
                            <span class="indicator">
                                <uc8:usrMaritalStatus ID="ddlMaritalStatus" runat="server" IsEnabled="true" ValidationGroup="profile"
                                    ErrorMessage="Choose Marital status." />
                            </span>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row">
                        <label for="" class="mand_red">
                            Type of Identification
                        </label>
                        <div class="field usernameid">
                            <span class="indicator">
                                <uc5:usrIdType ID="ddlIDType" runat="server" IsEnabled="true" ValidationGroup="profile"
                                    ErrorMessage="Choose ID Type." />
                            </span>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row">
                        <label for="" class="mand_red">
                            NRIC / FIN Number
                        </label>
                        <div class="field">
                            <span class="indicator">
                                <uc6:usrIdNumber ID="txtIdNumber" runat="server" IdNoErrorMessage="ID number is not valid."
                                    IdNoLengthErrorMessage="ID number must be 7 digits." IdNoRequireErrorMessage="Require ID number."
                                    IsEnabled="true" PostfixErrorMessage="Choose ID number initial character." PrefixErrorMessage="Choose ID number last character."
                                    ValidationGroup="profile" />
                            </span>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row">
                        <label for="" class="mand_red">
                            Years of Driving in Singapore</label>
                        <div class="field">
                            <span class="indicator">
                                <asp:DropDownList ID="ddlYearDriveSg" runat="server">
                                </asp:DropDownList>
                                <span><a href="/tooltips/year_driving_exp_sg.htm?width=250" class="jTip" id="one"
                                    name="Years of Driving in Singapore">
                                    <img src="/images/icons/help.gif" alt="Help" width="16" height="18" align="absmiddle" /></a></span>
                                <div class="clear">
                                </div>
                                <asp:RequiredFieldValidator validationErrorCssClass="validationError" ID="rfvYearDriveSg"
                                    runat="server" ControlToValidate="ddlYearDriveSg" ErrorMessage="" InitialValue="-1"
                                    ValidationGroup="profile" Display="Dynamic" Text=""></asp:RequiredFieldValidator>
                                <asp:CustomValidator ValidationGroup="carprofile" validationErrorCssClass="validationError"
                                    ID="csvAgeAndYear" OnServerValidate="CheckAgeAndYear" ControlToValidate="ddlYearDriveSg"
                                    runat="server" ErrorMessage=""></asp:CustomValidator>
                            </span>
                        </div>
                    </div>
                    <div class="row">
                        <label for="Home Phone Number">
                            Home Phone Number
                        </label>
                        <div class="field">
                            <span class="indicator">
                                <uc7:usrPhoneNo ID="txtHomePhoneNo" ValidationGroup="profile" IsEnabled="true" PhoneNoErrorMessage="Home Phone No must be number value."
                                    PhoneNoValidErrorMessage="Home phone no is not valid." IsRequired="false" PhoneNoRequireErrorMessage=""
                                    runat="server" />
                            </span>
                            <%--<span class="indicator">+65&nbsp;</span> <span class="indicator">
                                <asp:TextBox ID="txtHomePhoneNo" class="text" runat="server" MaxLength="8"></asp:TextBox>
                                <asp:CustomValidator validationErrorCssClass="validationError" ID="csvHomePhoneNo"
                                    runat="server" ClientValidationFunction="PhoneNoClientValidate" ControlToValidate="txtHomePhoneNo"
                                    ErrorMessage="Home phone no is not valid." OnServerValidate="PhoneNoServerValidation"
                                    ValidationGroup="profile" Text="*"></asp:CustomValidator>
                                <asp:RegularExpressionValidator validationErrorCssClass="validationError" ID="revHomePhone"
                                    runat="server" ValidationExpression="[0-9]{8}" ControlToValidate="txtHomePhoneNo"
                                    ErrorMessage="Home phone no must be 8 digits number value." ValidationGroup="profile"
                                    Text="*"></asp:RegularExpressionValidator>
                            </span>--%>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row">
                        <label for="mobileno" class="mand_red">
                            Mobile Number</label>
                        <div class="field">
                            <span class="indicator">
                                <uc7:usrPhoneNo ID="txtMobileNo" ValidationGroup="profile" IsEnabled="true" PhoneNoErrorMessage="Mobile Phone No must be number value."
                                    PhoneNoValidErrorMessage="Mobile phone no is not valid." IsRequired="true" PhoneNoRequireErrorMessage="Require Mobile Phone No."
                                    runat="server" />
                            </span>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div style="display: none">
                        <asp:TextBox ID="txtIdTypePrefix" Text="false" runat="server"></asp:TextBox>
                        <asp:CustomValidator ControlToValidate="txtIdTypePrefix" ID="csvIdTypePrefix" runat="server"
                            ValidationGroup="profile" OnServerValidate="CheckIdTypePrefixValid" ClientValidationFunction="CheckIdTypePrefix"></asp:CustomValidator>
                    </div>
                    <%--<div class="row" style="display: none">
                            <asp:TextBox ID="txtSalGenderValid" Text="Valid" runat="server"></asp:TextBox>
                            <asp:CustomValidator validationErrorCssClass="validationError" ControlToValidate="txtSalGenderValid"
                                ValidationGroup="profile" ID="csvSalGender" ClientValidationFunction="CheckSalGenderValid"
                                OnServerValidate="CheckSalGenderValid" runat="server" ErrorMessage="Salutation and gender do not match."
                                Text=""></asp:CustomValidator>
                        </div>--%>
                    <div class="row">
                        <label for="Office Phone Number">
                            Office Phone Number
                        </label>
                        <div class="field">
                            <span class="indicator">
                                <uc7:usrPhoneNo ID="txtOfficeNo" ValidationGroup="profile" IsEnabled="true" PhoneNoErrorMessage="Office Phone No must be number value."
                                    PhoneNoValidErrorMessage="Office phone no is not valid." IsRequired="false" PhoneNoRequireErrorMessage=""
                                    runat="server" />
                            </span>
                            <%--<span class="indicator">+65&nbsp;</span> <span class="indicator">
                                <asp:TextBox ID="txtOfficeNo" class="text" runat="server" MaxLength="8"></asp:TextBox>
                                <asp:CustomValidator validationErrorCssClass="validationError" ID="csvOfficePhoneNo"
                                    runat="server" ClientValidationFunction="PhoneNoClientValidate" ControlToValidate="txtOfficeNo"
                                    ErrorMessage="Office phone no is not valid." OnServerValidate="PhoneNoServerValidation"
                                    ValidationGroup="profile" Text="*"></asp:CustomValidator>
                                <asp:RegularExpressionValidator validationErrorCssClass="validationError" ID="revOfficeNo"
                                    runat="server" ValidationExpression="[0-9]{8}" ControlToValidate="txtOfficeNo"
                                    ErrorMessage="Office phone no must be 8 digits number value." ValidationGroup="profile"
                                    Text="*"></asp:RegularExpressionValidator>
                            </span>--%>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row">
                        <label>
                        </label>
                        <div class="field">
                            <br />
                            <span class="button2">
                                <%--<asp:ImageButton ID="ibtSubmit" runat="server"
                            class="img_align_right" OnClientClick="LoadValidationErrorCss();" ImageUrl="~/images/buttons/submit_but.gif" OnClick="ImageButton1_Click"
                            ValidationGroup="profile" onmouseover="this.src='/images/buttons/submit_but_o.gif';"
                            onmouseout="this.src='/images/buttons/submit_but.gif';" />--%>
                                <asp:Button ID="btnSubmit" runat="server" CssClass="button_submit" ValidationGroup="profile"
                                    OnClientClick="LoadValidationErrorCss();if (Page_ClientValidate('profile')){this.removeAttribute('onmouseout'); this.removeAttribute('onmouseup'); this.className='button_processing';}"
                                    onmousedown="this.className = 'button_submit_mousedown';" onmouseup="this.className = 'button_submit';"
                                    onmouseout="this.className = 'button_submit';" OnClick="btnSubmit_Click" />
                            </span>
                        </div>
                    </div>
                </fieldset>
            </div>
        </div>
    </div>
    </div>
    <script type="text/javascript">
        //<![CDATA[

        function ShowRequireMessage(ctrlMessage, strMessage) {
            alert(strMessage);
            if (document.getElementById(ctrlMessage).textContent) {
                document.getElementById(ctrlMessage).textContent = strMessage;
            }
            else {
                document.getElementById(ctrlMessage).innerText = strMessage;
            }
        }

        function CheckSalutation(sender, args) {
            var ctrlSelect = document.getElementById('<=ddlSalutation.ClientID>');

            if (ctrlSelect.value == -1) {
                args.IsValid = false;
            }
        }

        function checkEmail() {
            var email = document.getElementById('emailaddress');
            var filter = "/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/";
            if (!filter.test(email.value)) {
                alert('Please provide a valid email address');
                email.focus
                return false;
            }
        }

        function CheckMobileNoClientValidate(source, arguments) {
            var cval = parseInt(arguments.Value)
            if (isNaN(cval)) {
                arguments.IsValid = false;
            } else {
                var cstrVal = "" + cval + "";
                if (cstrVal.length < 8) {
                    arguments.IsValid = false;
                }
                else {
                    arguments.IsValid = true;
                }
            }
        }

        function CheckOfficeNoClientValidate(source, arguments) {
            var cval = parseInt(arguments.Value)
            if (isNaN(cval)) {
                arguments.IsValid = false;
            } else {
                var cstrVal = "" + cval + "";
                if (cstrVal.length < 8) {
                    arguments.IsValid = false;
                }
                else {
                    arguments.IsValid = true;
                }
            }
        }
        function hasWhiteSpace(s) {

            reWhiteSpace = new RegExp(/^\s+$/);

            // Check for white space
            if (reWhiteSpace.test(s)) {
                alert("Please Check Your Fields For Spaces");
                return true;
            }
            return false;
        }

        function trim(stringToTrim) {
            return stringToTrim.replace(/^\s+|\s+$/g, "");
        }


        function ShowKeyCode(e) {
            var code;
            if (!e) var e = window.event;
            if (e.keyCode) code = e.keyCode;
            else if (e.which) code = e.which;
            if (code == 18) {
                code = 0;
                alert('Not allow!');
            }

            return false;
            //var character = String.fromCharCode(code);
            //alert('Character was ' + character);
        }

        function CheckPasswordLength(source, arguments) {
            //var corglen = arguments.Value;
            var cval = arguments.Value;
            var bValid = true;
            var chList = new Array(20);
            var ctrlsource = document.getElementById(source.id);

            //alert("ORG LEN : " + corglen.length + " AFTER : " + cval.length);
            if (cval.indexOf(' ') != -1 || cval.indexOf('\'') != -1
                        || cval.indexOf('\"') != -1 || cval.indexOf('~') != -1) {
                if (ctrlsource.textContent) {
                    ctrlsource.textContent = "Password include invalid character or space!";
                }
                else {
                    ctrlsource.innerText = "Password include invalid character or space!";
                }

                ctrlsource.errormessage = "Password include invalid character or space!";
                bValid = false;
            }
            else if (cval.length < 6) {
                //ctrlsource.innerText = "Password length should be at least 6";
                if (ctrlsource.textContent) {
                    ctrlsource.textContent = "Password length should be at least 6";
                }
                else {
                    ctrlsource.innerText = "Password length should be at least 6";
                }

                ctrlsource.errormessage = "Password length should be at least 6";
                bValid = false;
            }
            else if (cval.length > 20) {
                bValid = false;
                //ctrlsource.innerText = "Password length should not be over 20!";
                if (ctrlsource.textContent) {
                    ctrlsource.textContent = "Password length should not be over 20!";
                }
                else {
                    ctrlsource.innerText = "Password length should not be over 20!";
                }
                ctrlsource.errormessage = "Password length should not be over 20!";
            }
            else {
                bValid = true;
            }
            //alert(cval);
            //if (isNaN(cval)){
            //    bValid = false;
            //} 


            //alert(bValid);
            arguments.IsValid = bValid;
            return;
        }
        var hookValDate = false;
        function HookDateValidation() {
            if (hookValDate == false) {

                var prefix = "<%=usrDOB.ClientID%>";
                //alert(prefix);
                var ddlMonth = prefix + "_ddlMonth";
                var ddlYear = prefix + "_ddlYear";
                var valCtrl = prefix + "_csvDate";
                //alert(ddlYear);
                ValidatorHookupControlID(ddlMonth, document.getElementById(valCtrl));
                ValidatorHookupControlID(ddlYear, document.getElementById(valCtrl));
                hookValDate = true;
            }
        }

        function CheckSalGenderValid(source, arguments) {
            var ctrlsal = document.getElementById('<=ddlSalutation.ClientID>' + '_ddlSal');
            var ctrlgender = document.getElementById('<=ddlGender.ClientID>' + '_ddlGender');
            var sal = ctrlsal.value;
            var gender = ctrlgender.value;

            //alert(sal);
            //alert(gender);
            var result = true;
            if (gender == 'M') {
                if (sal == 'Ms' || sal == 'Miss' || sal == 'Mdm') {
                    result = false;
                }
            }
            else if (gender == 'F') {
                if (sal == 'Mr' || sal == 'Mrs') {
                    result = false;
                }
            }

            if (result == false) {
                ctrlsal.style.backgroundColor = '#fcc';
                ctrlsal.style.border = 'Solid 1px #f00';
                //ctrlsal.style.fontWeight = 'bold';

                ctrlgender.style.backgroundColor = '#fcc';
                ctrlgender.style.border = 'Solid 1px #f00';
                //ctrlgender.style.fontWeight = 'bold';
            }
            else {
                ctrlsal.style.backgroundColor = '';
                ctrlsal.style.border = '';
                //ctrlsal.style.fontWeight = '';

                ctrlgender.style.backgroundColor = '';
                ctrlgender.style.border = '';
                //ctrlgender.style.fontWeight = '';
            }
            arguments.IsValid = result;
        }

        function CheckIdTypePrefix(source, arguments) {
            var usrIdType = document.getElementById('<%=ddlIDType.ClientID%>' + "_ddlIdType");
            var usrIdNumber = document.getElementById('<%=txtIdNumber.ClientID%>' + "_ddlIdPrefix");
            var result = true;
            var IdType = usrIdType.value;
            var IdNumber = usrIdNumber.value;
            if (IdType != null) {
                if (IdType == "-1" || IdNumber == "-1") {
                    return false;
                }

                if (IdType == "SPR" || IdType == "PR") {
                    if (IdNumber != "S" && IdNumber != "T") {
                        result = false;
                    }
                    else {
                        result = true;
                    }
                }
                else {
                    if (IdNumber != "G" && IdNumber != "F") {
                        result = false;
                    }
                    else {
                        result = true;
                    }
                }
            }
            if (result == false) {
                usrIdType.style.backgroundColor = '#fcc';
                usrIdType.style.border = 'Solid 1px #f00';
                //ctrlsal.style.fontWeight = 'bold';

                usrIdNumber.style.backgroundColor = '#fcc';
                usrIdNumber.style.border = 'Solid 1px #f00';
                //ctrlgender.style.fontWeight = 'bold';
            }
            else {
                usrIdType.style.backgroundColor = '';
                usrIdType.style.border = '';
                //ctrlsal.style.fontWeight = '';

                usrIdNumber.style.backgroundColor = '';
                usrIdNumber.style.border = '';
                //ctrlgender.style.fontWeight = '';
            }
            if (arguments != null)
                arguments.IsValid = result;
        }

        function CheckAll() {
            HookDateValidation();
        }

        //]]>
                
    </script>

</asp:Content>
